package com.bub.pay.framework.shiro.authc;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.apache.shiro.authc.UsernamePasswordToken;

@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
public class UserToken extends UsernamePasswordToken {

    private String googleCode;

    private Integer userType;

    private String reqIp;

    private boolean limitIp = true;

    public UserToken(final Integer userType, final String username, final String password, final String googleCode, final String reqIp) {
        super(username, password, false, null);
        this.googleCode = googleCode;
        this.userType = userType;
        this.reqIp = reqIp;
    }

    public UserToken(final Integer userType, final String username, final String password, final String googleCode, final String reqIp,final boolean limitIp) {
        super(username, password, false, null);
        this.googleCode = googleCode;
        this.userType = userType;
        this.reqIp = reqIp;
        this.limitIp = limitIp;
    }

}
